<?php
/* @var $this PrescriptionheaderController */
/* @var $model Prescriptionheader */
/* @var $form CActiveForm */
?>

<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'prescriptionheader-form',
	// Please note: When you enable ajax validation, make sure the corresponding
	// controller action is handling ajax validation correctly.
	// There is a call to performAjaxValidation() commented in generated controller code.
	// See class documentation of CActiveForm for details on this.
	'enableAjaxValidation'=>false,
)); ?>

	<p class="note">Fields with <span class="required">*</span> are required.</p>

	<?php echo $form->errorSummary($model); ?>
	
	<div class="row">
                <?php echo $form->labelEx($model,'date'); ?>
                        <?php $this->widget('zii.widgets.jui.CJuiDatePicker', array(
        'model'=>$model, 'attribute'=>'date',
        'options'=>array(
            'dateFormat'=>'yy-mm-dd',
            'yearRange'=>'-20:+20',
            'changeYear'=>'true',
            'changeMonth'=>'true',
        ),
                )); ?>
                <?php echo $form->error($model,'date'); ?>
	
	<div class="row">
		<?php echo $form->labelEx($model,'patient_id'); ?>
                <?php echo $form->dropDownList ($model, 'patient_id', CHtml::listData(
                Patient::model()->findAll(), 'id','patient_lastname'),
                        array('prompt' => 'Select a patient')
                        ); ?>
                <?php echo $form->error($model,'patient_id'); ?>
        </div>

	<div class="row">
		<?php echo $form->labelEx($model,'employee_id'); ?>
		 <?php echo $form->dropDownList ($model, 'employee_id', CHtml::listData(
                Employee::model()->findAll(), 'id','emp_lastname'),
                        array('prompt' => 'Select an employee')
                        ); ?>
                <?php echo $form->error($model,'employee_id'); ?>
        </div>

	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save'); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->